package com.neussoft.neu24.dibuy.repository;

import com.neussoft.neu24.dibuy.entity.DemoUser;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

/**
 * @program: learn
 * @description:
 * @author: Jingdi.Duan ,duanjingdi@msn.com
 * @create: 2024-07-10 15:02
 **/
@Repository

public interface UserRepository extends R2dbcRepository<DemoUser, Integer> {
    @Query("select   u.id, username, password, email, phone, create_time, update_time\n" +
            "from t_user   u  where u.username  = :username")
    Flux<DemoUser> findByUsername(String username);

    // 规范起名
//    @Query注解，自定义SQL
//    Converter
    Flux<DemoUser> findByUsernameAndPassword(String username, String password);


//


}
